Optimal. Leaf size=59 \[ \frac {(a-2 b) \text {ArcTan}(\sinh (x))}{2 a^2}+\frac {b^{3/2} \text {ArcTan}\left (\frac {\sqrt {b} \sinh (x)}{\sqrt {a+b}}\right )}{a^2 \sqrt {a+b}}+\frac {\text {sech}(x) \tanh (x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3265, 425, 536,
209, 211} \begin {gather*} \frac {b^{3/2} \text {ArcTan}\left (\frac {\sqrt {b} \sinh (x)}{\sqrt {a+b}}\right )}{a^2 \sqrt {a+b}}+\frac {(a-2 b) \text {ArcTan}(\sinh (x))}{2 a^2}+\frac {\tanh (x) \text {sech}(x)}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 211
Rule 425
Rule 536
Rule 3265
Rubi steps
\begin {align*} \int \frac {\text {sech}^3(x)}{a+b \cosh ^2(x)} \, dx &=\text {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2 \left (a+b+b x^2\right )} \, dx,x,\sinh (x)\right )\\ &=\frac {\text {sech}(x) \tanh (x)}{2 a}-\frac {\text {Subst}\left (\int \frac {-a+b-b x^2}{\left (1+x^2\right ) \left (a+b+b x^2\right )} \, dx,x,\sinh (x)\right )}{2 a}\\ &=\frac {\text {sech}(x) \tanh (x)}{2 a}+\frac {(a-2 b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sinh (x)\right )}{2 a^2}+\frac {b^2 \text {Subst}\left (\int \frac {1}{a+b+b x^2} \, dx,x,\sinh (x)\right )}{a^2}\\ &=\frac {(a-2 b) \tan ^{-1}(\sinh (x))}{2 a^2}+\frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \sinh (x)}{\sqrt {a+b}}\right )}{a^2 \sqrt {a+b}}+\frac {\text {sech}(x) \tanh (x)}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 58, normalized size = 0.98 \begin {gather*} \frac {-\frac {2 b^{3/2} \text {ArcTan}\left (\frac {\sqrt {a+b} \text {csch}(x)}{\sqrt {b}}\right )}{\sqrt {a+b}}+2 (a-2 b) \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )+a \text {sech}(x) \tanh (x)}{2 a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(122\) vs.
\(2(47)=94\).
time = 0.82, size = 123, normalized size = 2.08
method | result | size |
default | \(\frac {\frac {2 \left (-\frac {a \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{2}+\frac {a \tanh \left (\frac {x}{2}\right )}{2}\right )}{\left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+\left (-2 b +a \right ) \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a^{2}}+\frac {2 b^{2} \left (\frac {\arctan \left (\frac {2 \sqrt {a +b}\, \tanh \left (\frac {x}{2}\right )+2 \sqrt {a}}{2 \sqrt {b}}\right )}{2 \sqrt {a +b}\, \sqrt {b}}+\frac {\arctan \left (\frac {2 \sqrt {a +b}\, \tanh \left (\frac {x}{2}\right )-2 \sqrt {a}}{2 \sqrt {b}}\right )}{2 \sqrt {a +b}\, \sqrt {b}}\right )}{a^{2}}\) | \(123\) |
risch | \(\frac {{\mathrm e}^{x} \left ({\mathrm e}^{2 x}-1\right )}{\left (1+{\mathrm e}^{2 x}\right )^{2} a}-\frac {i b \ln \left ({\mathrm e}^{x}+i\right )}{a^{2}}+\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{2 a}+\frac {i b \ln \left ({\mathrm e}^{x}-i\right )}{a^{2}}-\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{2 a}+\frac {\sqrt {-b \left (a +b \right )}\, b \ln \left ({\mathrm e}^{2 x}+\frac {2 \sqrt {-b \left (a +b \right )}\, {\mathrm e}^{x}}{b}-1\right )}{2 \left (a +b \right ) a^{2}}-\frac {\sqrt {-b \left (a +b \right )}\, b \ln \left ({\mathrm e}^{2 x}-\frac {2 \sqrt {-b \left (a +b \right )}\, {\mathrm e}^{x}}{b}-1\right )}{2 \left (a +b \right ) a^{2}}\) | \(154\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 444 vs.
\(2 (47) = 94\).
time = 0.42, size = 963, normalized size = 16.32 \begin {gather*} \left [\frac {2 \, a \cosh \left (x\right )^{3} + 6 \, a \cosh \left (x\right ) \sinh \left (x\right )^{2} + 2 \, a \sinh \left (x\right )^{3} + {\left (b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, b \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + b \cosh \left (x\right )\right )} \sinh \left (x\right ) + b\right )} \sqrt {-\frac {b}{a + b}} \log \left (\frac {b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} - 2 \, {\left (2 \, a + 3 \, b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} - 2 \, a - 3 \, b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} - {\left (2 \, a + 3 \, b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + 4 \, {\left ({\left (a + b\right )} \cosh \left (x\right )^{3} + 3 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right )^{2} + {\left (a + b\right )} \sinh \left (x\right )^{3} - {\left (a + b\right )} \cosh \left (x\right ) + {\left (3 \, {\left (a + b\right )} \cosh \left (x\right )^{2} - a - b\right )} \sinh \left (x\right )\right )} \sqrt {-\frac {b}{a + b}} + b}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + 2 \, a + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + {\left (2 \, a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}\right ) + 2 \, {\left ({\left (a - 2 \, b\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a - 2 \, b\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a - 2 \, b\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a - 2 \, b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (a - 2 \, b\right )} \cosh \left (x\right )^{2} + a - 2 \, b\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a - 2 \, b\right )} \cosh \left (x\right )^{3} + {\left (a - 2 \, b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + a - 2 \, b\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - 2 \, a \cosh \left (x\right ) + 2 \, {\left (3 \, a \cosh \left (x\right )^{2} - a\right )} \sinh \left (x\right )}{2 \, {\left (a^{2} \cosh \left (x\right )^{4} + 4 \, a^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + a^{2} \sinh \left (x\right )^{4} + 2 \, a^{2} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, a^{2} \cosh \left (x\right )^{2} + a^{2}\right )} \sinh \left (x\right )^{2} + a^{2} + 4 \, {\left (a^{2} \cosh \left (x\right )^{3} + a^{2} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )}}, \frac {a \cosh \left (x\right )^{3} + 3 \, a \cosh \left (x\right ) \sinh \left (x\right )^{2} + a \sinh \left (x\right )^{3} + {\left (b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, b \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + b \cosh \left (x\right )\right )} \sinh \left (x\right ) + b\right )} \sqrt {\frac {b}{a + b}} \arctan \left (\frac {1}{2} \, \sqrt {\frac {b}{a + b}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}\right ) + {\left (b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, b \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + b \cosh \left (x\right )\right )} \sinh \left (x\right ) + b\right )} \sqrt {\frac {b}{a + b}} \arctan \left (\frac {{\left (b \cosh \left (x\right )^{3} + 3 \, b \cosh \left (x\right ) \sinh \left (x\right )^{2} + b \sinh \left (x\right )^{3} + {\left (4 \, a + 3 \, b\right )} \cosh \left (x\right ) + {\left (3 \, b \cosh \left (x\right )^{2} + 4 \, a + 3 \, b\right )} \sinh \left (x\right )\right )} \sqrt {\frac {b}{a + b}}}{2 \, b}\right ) + {\left ({\left (a - 2 \, b\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a - 2 \, b\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a - 2 \, b\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a - 2 \, b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (a - 2 \, b\right )} \cosh \left (x\right )^{2} + a - 2 \, b\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a - 2 \, b\right )} \cosh \left (x\right )^{3} + {\left (a - 2 \, b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + a - 2 \, b\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - a \cosh \left (x\right ) + {\left (3 \, a \cosh \left (x\right )^{2} - a\right )} \sinh \left (x\right )}{a^{2} \cosh \left (x\right )^{4} + 4 \, a^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + a^{2} \sinh \left (x\right )^{4} + 2 \, a^{2} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, a^{2} \cosh \left (x\right )^{2} + a^{2}\right )} \sinh \left (x\right )^{2} + a^{2} + 4 \, {\left (a^{2} \cosh \left (x\right )^{3} + a^{2} \cosh \left (x\right )\right )} \sinh \left (x\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {sech}^{3}{\left (x \right )}}{a + b \cosh ^{2}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.56, size = 447, normalized size = 7.58 \begin {gather*} \frac {\mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\left (a^7\,{\left (a^4\right )}^{3/2}-12\,b^3\,{\left (a^4\right )}^{5/2}-18\,b^7\,{\left (a^4\right )}^{3/2}+36\,a^2\,b^5\,{\left (a^4\right )}^{3/2}-30\,a^3\,b^4\,{\left (a^4\right )}^{3/2}+21\,a^5\,b^2\,{\left (a^4\right )}^{3/2}+9\,a\,b^6\,{\left (a^4\right )}^{3/2}-8\,a^6\,b\,{\left (a^4\right )}^{3/2}\right )}{a^{12}\,\sqrt {a^2-4\,a\,b+4\,b^2}-6\,a^{11}\,b\,\sqrt {a^2-4\,a\,b+4\,b^2}+9\,a^6\,b^6\,\sqrt {a^2-4\,a\,b+4\,b^2}-18\,a^8\,b^4\,\sqrt {a^2-4\,a\,b+4\,b^2}+6\,a^9\,b^3\,\sqrt {a^2-4\,a\,b+4\,b^2}+9\,a^{10}\,b^2\,\sqrt {a^2-4\,a\,b+4\,b^2}}\right )\,\sqrt {a^2-4\,a\,b+4\,b^2}}{\sqrt {a^4}}-\frac {2\,{\mathrm {e}}^x}{a\,\left (2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1\right )}+\frac {{\mathrm {e}}^x}{a\,\left ({\mathrm {e}}^{2\,x}+1\right )}-\frac {{\left (-b\right )}^{3/2}\,\ln \left (\frac {64\,\left ({\mathrm {e}}^{2\,x}-1\right )\,\left (a^3-3\,a^2\,b+3\,b^3\right )}{a^5\,{\left (a+b\right )}^2}-\frac {128\,{\mathrm {e}}^x\,\left (a^3-3\,a^2\,b+3\,b^3\right )}{a^5\,\sqrt {-b}\,{\left (a+b\right )}^{3/2}}\right )}{2\,a^2\,\sqrt {a+b}}+\frac {{\left (-b\right )}^{3/2}\,\ln \left (\frac {64\,\left ({\mathrm {e}}^{2\,x}-1\right )\,\left (a^3-3\,a^2\,b+3\,b^3\right )}{a^5\,{\left (a+b\right )}^2}+\frac {128\,{\mathrm {e}}^x\,\left (a^3-3\,a^2\,b+3\,b^3\right )}{a^5\,\sqrt {-b}\,{\left (a+b\right )}^{3/2}}\right )}{2\,a^2\,\sqrt {a+b}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________